package com.abe.mvp.view.fragment;

import java.util.ArrayList;
import java.util.List;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.abe.config.SettingParam;
import com.abe.mvp.model.bean.MenuBean;
import com.abe.mvp.view.activity.FragmentCallbackListener.SettingCallbackListener;
import com.abe.mvp.view.adapter.SettingMenuAdapter;
import com.abe.mvp.view.fragment.base.BaseSettingFragment;
import com.abe.strengthtrainer.R;

@SuppressLint("InflateParams")
public class SettingDeviceFragment extends BaseSettingFragment {

	@SuppressWarnings("unused")
	private SettingCallbackListener callback;

	private ListView device_list_type;
	private List<MenuBean> menuBeans;
	private SettingMenuAdapter adapter;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		callback = (SettingCallbackListener) getActivity();
		View view = this.onCreateView(inflater,
				R.layout.activity_set_fragment_device, container,
				savedInstanceState);
		initView(view);
		return view;
	}

	public void initView(View view) {
		device_list_type = (ListView) view.findViewById(R.id.device_list_type);
		menuBeans=new ArrayList<MenuBean>();
		for (int i = 0; i < SettingParam.device_type.length; i++) {
			MenuBean bean=new MenuBean();
			bean.setNameStr(SettingParam.device_type[i]);
			bean.setSelected(false);
			menuBeans.add(bean);
		}
		adapter = new SettingMenuAdapter(getActivity(),menuBeans,scale,SettingMenuAdapter.TYPE_LIST);
		device_list_type.setAdapter(adapter);
	}

	@Override
	protected void saveChange() {

	}
}
